import moment from 'moment'
export default () => {
  const zoneName = moment.tz.guess()
  const timeZoneShortName = moment.tz(zoneName).format('zz')

  const isNumber = /^[a-zA-Z]+$/.test(timeZoneShortName)

  return {
    timezoneName: isNumber ? timeZoneShortName : `UTC${timeZoneShortName}`,
    timezoneOffset: moment.tz(zoneName).format('Z'),
    timezoneId: zoneName
  }
}
